package com.jt.config;


import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//MP分页api需要配置的拦截器
//配置类
@Configuration
//分页的时候需要配置拦截器
public class MyBatisInterceptor {
    //@Bean指的是这个下面的这个方法交给spring进行管理
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor Interceptor=new MybatisPlusInterceptor();
        Interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MARIADB));
        return Interceptor;
    }
}
